<?php if ($pager->haveToPaginate()): ?>
  <div class="pagination">
    <?php echo link_to('上一页', "@{$route}?page={$pager->getPreviousPage()}") ?>
    <?php foreach ($pager->getLinks() as $page): ?>
      <?php if ($pager->getPage() == $page): ?>
        <?php echo "[$page]" ?>
      <?php else: ?>
        <?php echo link_to("[$page]", "@{$route}?page={$page}") ?>
      <?php endif ?>
    <?php endforeach ?>
    <?php echo link_to('下一页', "@{$route}?page={$pager->getNextPage()}") ?>
  </div>
<?php endif ?>

